SET IDENTITY_INSERT [CMS_Query] ON
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6072, N'selectByDocumentID', 0, N'SELECT ##TOPN## * FROM CMS_Category INNER JOIN CMS_DocumentCategory ON CMS_Category.CategoryID = CMS_DocumentCategory.CategoryID WHERE (CMS_DocumentCategory.DocumentID = @DocumentID) AND ##WHERE## ORDER BY ##ORDERBY##', 0, 1721, 0, '20080730 11:30:00', 'd867f859-ecf1-25ee-9bf8-258a97ef9812', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6194, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Tag WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1738, 0, '20081229 09:07:24', '932e5aa0-3579-44a2-87dc-5c0b9abc324c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6201, N'selectbyurlpath', 0, N'SELECT ##COLUMNS## FROM CMS_DocumentAlias WHERE [AliasUrlPath] = @UrlPath', 0, 1719, 0, '20080815 13:57:15', 'c690e989-b10e-45a8-be5a-68db140cbb79', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6235, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_AlternativeForm WHERE [FormID] = @ID', 0, 1745, 0, '20081229 09:06:53', 'a7680013-b106-41a1-bd69-ab60ac565e4a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6239, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_AlternativeForm WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1745, 0, '20081229 09:06:53', '9c1d7794-2ddf-4e23-9891-383324500af3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6245, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_TimeZone WHERE [TimeZoneID] = @ID', 0, 1747, 0, '20081229 09:07:39', '3c23bbbd-53e8-4a4d-9567-ad07c98a7ccb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6249, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_TimeZone WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1747, 0, '20081229 09:07:39', '4396c686-91b9-47c7-8eaf-f7e51a9b1d6e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6250, N'selectByTimeZoneName', 0, N'SELECT * FROM CMS_TimeZone WHERE TimeZoneName = @TimeZoneName', 0, 1747, 0, '20080811 10:59:45', '62a51bc6-2764-4666-af62-ffd57c035efe', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6257, N'selectbywildcardrule', 0, N'SELECT ##COLUMNS## FROM CMS_DocumentAlias INNER JOIN CMS_Tree ON CMS_DocumentAlias.AliasNodeID = CMS_Tree.NodeID WHERE (@UrlPath=AliasURLPath OR @WildcardRule LIKE CMS_DocumentAlias.AliasWildcardRule) AND CMS_Tree.NodeSiteID = @SiteID ORDER BY AliasPriority', 0, 1719, 0, '20091016 13:40:56', 'da70049a-d6bb-49cc-a256-23184e01c6ae', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6262, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Community_GroupMember WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1749, 0, '20081229 09:07:08', '93ac2993-591c-478b-a0b1-0902f3f3fdbd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6371, N'selectbyfullname', 0, N'SELECT ##COLUMNS## FROM CMS_AlternativeForm, CMS_Class WHERE FormClassID=ClassID AND ClassName + ''.'' + FormName = @FullName', 0, 1745, 0, '20080814 00:00:00', 'a5ecec6e-6aa5-11dd-8b2b-ca9855d89593', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6372, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_User WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 59, 0, '20080815 11:00:48', '7e802215-8ab6-485a-b240-47fce0ed18be', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6454, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Badge WHERE [BadgeID] = @ID', 0, 1787, 0, '20090421 12:20:12', '098fc06b-0af2-4807-ba2d-67d23829585a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6458, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Badge WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1787, 0, '20090421 12:20:12', 'e605a8b5-acbf-4d7c-a22c-04cfd7a7be16', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6555, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Board_Moderator WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1804, 0, '20081229 09:07:11', '18530506-915f-4991-88f6-91798082ebf4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6490, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Board_Message WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1791, 0, '20081229 09:07:11', '883b48c5-3ef5-4531-b238-543e356b80da', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6522, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Board_Role WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1797, 0, '20081229 09:07:12', '85f19756-53ee-4cee-bb22-f1548f7b0d38', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6550, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM BadWords_WordCulture WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1803, 0, '20081229 09:06:54', 'c10ede15-a42e-476a-8f96-96390e95f4d7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6575, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Notification_Gateway WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1808, 0, '20081229 09:07:13', 'de5902db-af2d-45b5-9196-4e040c820029', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6581, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_EventLog WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 140, 0, '20100219 08:36:37', 'a53976a8-0a54-44a8-b606-e24f408750dd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6593, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_AttachmentForEmail WHERE [EmailID] = @EmailID AND [AttachmentID] = @AttachmentID', 0, 1811, 0, '20081229 09:06:54', 'd813a081-2389-45d6-9f64-e46bc3fd4618', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6608, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Notification_Template WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1813, 0, '20081229 09:07:13', '888b3359-c29f-4a0b-be89-7fccef5602bf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6613, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Notification_TemplateText WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1814, 0, '20081229 09:07:13', '9c6375cd-0eb6-49b7-b37c-4930ae1fb70d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6597, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_AttachmentForEmail WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1811, 0, '20081229 09:06:54', '52f33f72-230d-4223-8d86-1767d74c54c4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6618, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Notification_Subscription WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1815, 0, '20081229 09:07:13', '0f008d7f-6932-4576-9e77-eedc7bfc3481', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6858, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Messaging_ContactList WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1887, 0, '20081229 09:07:12', 'f91fda1a-dc1f-4509-814b-aca50c43788d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6863, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Messaging_IgnoreList WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1888, 0, '20081229 09:07:12', '46790628-e0d6-4226-9304-d105fa57c2e3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6904, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Board_Subscription WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1895, 0, '20081229 09:07:12', '0fbaf630-c4b6-4d9a-bf56-d7a1e9f5f758', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6962, N'selectallwithusername', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Board_Subscription 
LEFT JOIN CMS_User ON Board_Subscription.SubscriptionUserID = CMS_User.UserID 
WHERE (##WHERE##) ORDER BY ##ORDERBY##', 0, 1895, 0, '20090427 09:03:08', 'd4a48863-2124-452d-b586-d85da5cd3ec6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6963, N'selectallwithboard', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_Boards_BoardMessage_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1791, 0, '20100303 12:11:27', '0b9db1bc-8c24-42de-86e6-dfd7454774d7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7000, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Forums_UserFavorites WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1913, 0, '20081229 09:07:08', 'df86eb5b-fd48-4936-8f7d-8bd4647e8b3c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7062, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_EmailUser WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1926, 0, '20081229 09:07:04', '2ecdde83-d91e-441d-a460-1fc6027a55e7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7121, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Media_Library WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1934, 0, '20081229 09:07:11', 'ea479c68-788f-4259-b621-e61c698c254f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7136, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Media_LibraryRolePermission WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1937, 0, '20081229 09:07:11', '0a71d140-c46d-4508-8958-870af3093778', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7150, N'selectclasseswithaltforms', 0, N'SELECT DISTINCT ClassName, FormClassID FROM CMS_Class, CMS_AlternativeForm WHERE ClassID=FormClassID', 0, 1745, 0, '20081010 10:03:39', '61ecf5ed-8c4a-448d-bbed-0e35c56427a8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7280, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Community_Invitation WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1962, 0, '20081229 09:07:09', 'ff340d92-0867-4155-be82-6038f56dec01', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7344, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_DocumentAlias WHERE (AliasLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1719, 0, '20100322 15:37:58', '86230f48-9990-4661-bbf4-ab97a89b30c1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7643, N'resetstatus', 0, N'UPDATE CMS_Email SET [EmailStatus] = 1 WHERE [EmailStatus] = 2; UPDATE CMS_EmailUser SET [Status] = 1 WHERE [Status] = 2;', 1, 1809, 0, '20081231 15:15:20', 'c2d60729-91a6-45df-b67c-f7c038459dfc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7676, N'selectcount', 0, N'SELECT COUNT(EmailID) AS EmailCount FROM CMS_Email WHERE ##WHERE##', 0, 1809, 0, '20081127 14:29:07', 'b9bd03df-e4c4-435a-a6ed-5b4c3aeed915', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7743, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Community_GroupRolePermission WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1995, 0, '20081229 09:07:08', '56298bc0-5947-45e5-9e91-d10217467d03', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7906, N'selectallwithwebpartname', 0, N'SELECT CMS_WebPartLayout.*, CMS_WebPart.WebPartName FROM CMS_WebPartLayout JOIN CMS_WebPart ON CMS_WebPartLayout.WebPartLayoutWebPartID = CMS_WebPart.WebPartID WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1514, 0, '20090102 11:09:48', 'd54b7376-4824-4552-9ae9-902d2219fc84', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7923, N'selectforuser', 0, N'SELECT ##TOPN## BoardID, BoardDisplayName, BoardSiteID, Board_Subscription.*, NodeAliasPath, DocumentCulture FROM Board_Board LEFT JOIN Board_Subscription ON BoardID = SubscriptionBoardID LEFT JOIN View_CMS_Tree_Joined ON BoardDocumentID = DocumentID WHERE (SubscriptionUserID=@UserID) AND (##WHERE##)', 0, 1895, 0, '20091103 08:42:20', '90036e66-33ff-47c2-b0c0-d2368e3bc96a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7981, N'deletesitehistories', 0, N'IF @ExportSiteID = 0
	DELETE FROM Export_History WHERE ExportSiteID IS NULL
ELSE
	DELETE FROM Export_History WHERE ExportSiteID=@ExportSiteID', 0, 1616, 0, '20090218 19:17:53', '4fdde55d-45e8-4107-9d8e-a6c3f6e8f9ab', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8049, N'update', 0, N'UPDATE CMS_SearchIndexSite SET [IndexID] = @IndexID, [IndexSiteID] = @IndexSiteID WHERE [IndexID] = @IndexID AND [IndexSiteID] = @IndexSiteID', 0, 2044, 0, '20090320 19:08:26', 'bf66d1eb-d745-40e0-8b49-60624ea5e495', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8054, N'update', 0, N'SELECT NULL', 0, 2045, 0, '20090330 12:04:08', 'b5d75dd3-959b-49a1-a346-f32f0125ff3e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8057, N'selectuniquefilename', 0, N'SELECT DISTINCT AttachmentHistoryID, AttachmentName FROM CMS_AttachmentHistory WHERE AttachmentDocumentID=@AttachmentDocumentID AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 516, 0, '20090717 11:39:23', '55242b43-609b-4351-b3ea-a4c8f12a89d0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8063, N'initattachmentorder', 1, N'Proc_CMS_Attachment_InitAttachmentOrders', 1, 504, 0, '20090326 11:01:51', '681d5f9a-3ed6-44fe-8b79-71922c161931', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8064, N'moveattachmentup', 1, N'Proc_CMS_Attachment_MoveAttachmentUp', 0, 504, 0, '20090326 11:05:40', '05c005dd-ccee-4ccb-8447-d1412cf0802e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8065, N'moveattachmentdown', 1, N'Proc_CMS_Attachment_MoveAttachmentDown', 0, 504, 0, '20090326 11:05:57', '10bb63c6-26f9-48a6-9c89-80e8c8ebab1a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8066, N'initattachmenthistoryorder', 1, N'Proc_CMS_AttachmentHistory_InitAttachmentOrders', 1, 516, 0, '20090326 11:08:22', '17da0b0c-a6ef-4688-87b4-594ed2b4069f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8067, N'moveattachmenthistorydown', 1, N'Proc_CMS_AttachmentHistory_MoveAttachmentDown', 0, 516, 0, '20090326 11:08:42', 'd8f98096-091d-4227-b6bd-c29e0dfc8f95', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8068, N'moveattachmenthistoryup', 1, N'Proc_CMS_AttachmentHistory_MoveAttachmentUp', 0, 516, 0, '20090326 11:08:59', '310d19e0-fc7c-41a3-98b9-8141b334047b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8072, N'updatestatus', 0, N'UPDATE CMS_SearchTask SET SearchTaskStatus = @TaskStatus WHERE ##WHERE##', 0, 2046, 0, '20090331 14:04:25', 'cdf63884-c0a2-423d-90fe-c5391c04f83d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8754, N'getsites', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SearchIndexSite LEFT JOIN CMS_Site ON IndexSiteID = SiteID WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2044, 0, '20090424 14:59:31', 'aece93e8-2336-4feb-a70b-1817645058e9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8771, N'deleteforuser', 0, N'DELETE FROM CMS_UserCulture WHERE [UserID] = @UserID', 0, 2132, 0, '20090504 21:05:31', '49335cb8-5e9d-47c3-8854-19b49f21c2bc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8638, N'insert', 0, N'INSERT INTO CMS_UserCulture ([UserID], [CultureID], [SiteID] ) VALUES ( @UserID, @CultureID, @SiteID);', 1, 2132, 0, '20090420 14:23:06', 'adef48ac-f7b1-471f-b911-c6314f42aea5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8639, N'update', 0, N'SELECT NULL', 0, 2132, 0, '20090420 14:23:30', '4a5ea07d-559b-43b5-aecc-761c1d511c11', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8640, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_UserCulture WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2132, 0, '20090420 14:23:20', '9d9047ce-d028-4aaa-9794-5fa52acf32b4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8641, N'deleteculture', 0, N'DELETE FROM CMS_UserCulture WHERE [CultureID] = @CultureID AND [SiteID] = @SiteID', 0, 2132, 0, '20090420 14:24:30', 'ad759f14-9133-43be-9d24-b96bc3722cab', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8797, N'selectattachments', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_Tree_Joined_Attachments WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 144, 0, '20090515 11:19:46', '8ea4f096-8dac-4cf0-83e7-d2f62b5d1f1f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8819, N'removefromsite', 0, N'DELETE FROM CMS_UserCulture WHERE [UserID] = @UserID AND [SiteID] = @SiteID', 0, 2132, 0, '20090609 13:51:22', 'f334d0ea-ba12-4110-9fe6-377925624b81', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8990, N'selectcultures', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SearchIndexCulture LEFT JOIN CMS_Culture ON IndexCultureID = CultureID WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2045, 0, '20090825 14:04:29', 'cb7cfd6b-67df-457d-a6ba-5777883c60bf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8973, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_Community_Member WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1749, 0, '20090824 09:42:49', 'ffc59807-ca10-4e91-b5e3-72d907e445d7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9042, N'UpdateCategoryChildCount', 0, N'UPDATE CMS_WebPartCategory SET CategoryChildCount = (SELECT COUNT(*) FROM CMS_WebPartCategory WHERE CategoryParentID = @CategoryID) WHERE CategoryID = @CategoryID', 0, 424, 0, '20090827 12:12:45', 'e01a68bf-b07b-4ddb-9963-faaee858f014', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9043, N'OrderAlphabetically', 1, N'Proc_CMS_WebPartCategory_OrderAlphaAsc', 0, 424, 0, '20090827 10:36:00', '3be9805a-c0d3-4543-b285-407ee3a82eaa', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9044, N'UpdateCategoryWebPartChildCount', 0, N'UPDATE CMS_WebPartCategory SET CategoryWebPartChildCount = (SELECT COUNT(*) FROM CMS_WebPart WHERE WebPartCategoryID = @CategoryID) WHERE CategoryID = @CategoryID', 0, 424, 0, '20090827 12:29:19', '5352ea76-897a-4e4c-a744-e41fab5e7e8e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9045, N'SelectResourcePermission', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Resource 
LEFT JOIN CMS_Permission ON CMS_Resource.ResourceID = CMS_Permission.ResourceID 
WHERE PermissionName = @PermissionName AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 134, 0, '20090827 18:51:28', 'cbd22b70-d19f-48df-9a77-140a7878425b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9053, N'UpdateChildPaths', 1, N'Proc_CMS_WebpartCategory_UpdateChildPaths', 1, 424, 0, '20090901 16:02:57', 'ca40b24a-6622-43fc-99c6-9660951a8daf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9054, N'selectboardroles', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Role WHERE RoleID IN (SELECT RoleID FROM Board_Role WHERE BoardID = @BoardID)', 0, 1797, 0, '20090903 12:38:21', '4c127c1b-801d-43eb-af4f-cc95310c9a62', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9060, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_RoleUIElement WHERE [RoleID] = @RoleID AND [ElementID] = @ElementID', 0, 2196, 0, '20090903 12:16:18', '7da36c14-4d69-443d-bd0c-4ff76eb27c1d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9061, N'delete', 0, N'DELETE FROM CMS_RoleUIElement WHERE [RoleID] = @RoleID AND [ElementID] = @ElementID', 0, 2196, 0, '20090903 12:16:18', 'c6f6d905-0a14-4d95-9fc6-c3c4fa157bd0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9062, N'insert', 0, N'INSERT INTO CMS_RoleUIElement ([RoleID], [ElementID] ) VALUES ( @RoleID, @ElementID);', 1, 2196, 0, '20090903 12:16:18', 'babf5118-9dcb-4a20-a117-a040b19a00ad', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9063, N'update', 0, N'SELECT NULL', 0, 2196, 0, '20090903 12:16:18', '40b44759-ddcb-4aef-a988-afb9e40f99fa', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9064, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_RoleUIElement WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2196, 0, '20090903 12:16:18', '61dd16fe-e5b8-4a11-adba-9aa0ee44eb24', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9065, N'removedependencies', 1, N'Proc_CMS_UIElement_RemoveDependencies', 1, 2195, 0, '20090904 21:11:08', '46526aab-3270-47a4-8e60-7568ea2c0314', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9066, N'initorders', 1, N'Proc_CMS_UIElement_InitOrders', 0, 2195, 0, '20090904 22:08:42', 'bc354b88-e957-4687-bde2-757508e5d06e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9067, N'moveup', 1, N'Proc_CMS_UIElement_MoveUp', 0, 2195, 0, '20090904 22:10:16', 'da344a4f-63d8-4b0a-8adb-b1d31bb5e7bb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9068, N'movedown', 1, N'Proc_CMS_UIElement_MoveDown', 0, 2195, 0, '20090904 22:10:40', '9675be59-ef07-4043-ac9b-186506113537', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9069, N'setidpath', 0, N'UPDATE [CMS_UIElement] SET  [ElementIDPath] = @Path WHERE [ElementID] = @ID', 0, 2195, 0, '20090905 11:59:32', 'eeceaeed-12b7-41df-bfee-3814a4551e11', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9281, N'OrderAlphabetically', 1, N'Proc_CMS_PageTemplateCategory_OrderAlphaAsc', 0, 405, 0, '20091103 11:44:52', 'f79501c9-6fc3-4fe1-9fbb-750a7dc05d21', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9283, N'UpdateCategoryChildCount', 0, N'UPDATE CMS_PageTemplateCategory SET CategoryChildCount = (SELECT COUNT(*) FROM CMS_PageTemplateCategory WHERE CategoryParentID = @CategoryID) WHERE CategoryID = @CategoryID', 0, 405, 0, '20091103 10:02:27', '0ffb734f-4485-44d2-9b3e-ff269e120912', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9284, N'UpdateCategoryTemplateChildCount', 0, N'UPDATE CMS_PageTemplateCategory SET CategoryTemplateChildCount = (SELECT COUNT(*) FROM CMS_PageTemplate WHERE PageTemplateCategoryID = @CategoryID) WHERE CategoryID = @CategoryID', 0, 405, 0, '20091103 15:03:06', 'b8714ef3-b565-4f87-948e-fd04b17ec11b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9285, N'deleteall', 0, N'DELETE FROM Newsletter_Emails WHERE ##WHERE##', 0, 919, 0, '20091103 16:28:02', '4db95b11-9e2f-4d0c-9edc-fd77c324737f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9287, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_PageTemplateCategoryPageTemplate_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 405, 0, '20091103 14:02:13', '08055675-022e-4edd-bec9-51e94ce57b89', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9288, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_PageTemplateMetafile_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 157, 0, '20091103 19:19:00', '5b587ab8-ed7d-41e1-8140-013842b6e866', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9420, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_LayoutMetafile_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 410, 0, '20091106 16:22:19', 'd9bf229a-0286-46d3-8ebc-d61169a11deb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9449, N'selectusersessioncount', 0, N'SELECT DISTINCT COUNT(*) FROM View_CMS_User WHERE ##WHERE##', 0, 59, 0, '20091118 10:36:29', 'b322709d-3403-4426-9ad4-b11422ced6d3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9079, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_WidgetCategory WHERE [WidgetCategoryID] = @ID', 0, 2198, 0, '20091016 11:33:26', '3c13f8ac-3c01-4985-b81d-35a9785ebcc5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9080, N'delete', 0, N'DELETE FROM CMS_WidgetCategory WHERE [WidgetCategoryID] = @ID', 0, 2198, 0, '20091016 11:33:26', '6fb9650d-9a98-4157-a608-5a0db15d421b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9842, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_PageTemplateScope WHERE [PageTemplateScopeID] = @ID', 0, 2337, 0, '20100222 09:40:56', 'b8ea7eed-77b0-4d8b-b1aa-c202f3565296', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9843, N'delete', 0, N'DELETE FROM CMS_PageTemplateScope WHERE [PageTemplateScopeID] = @ID', 0, 2337, 0, '20100222 09:40:56', '1cd60867-6660-435c-a9de-db13a9702cc7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9844, N'insert', 0, N'INSERT INTO CMS_PageTemplateScope ([PageTemplateScopePath], [PageTemplateScopeLevels], [PageTemplateScopeCultureID], [PageTemplateScopeClassID], [PageTemplateScopeTemplateID], [PageTemplateScopeSiteID], [PageTemplateScopeLastModified], [PageTemplateScopeGUID] ) VALUES ( @PageTemplateScopePath, @PageTemplateScopeLevels, @PageTemplateScopeCultureID, @PageTemplateScopeClassID, @PageTemplateScopeTemplateID, @PageTemplateScopeSiteID, @PageTemplateScopeLastModified, @PageTemplateScopeGUID); SELECT SCOPE_IDENTITY() AS [PageTemplateScopeID]', 1, 2337, 0, '20100222 09:40:56', 'a9a7bc26-96f2-4be3-9fcc-1f4bef380086', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9845, N'update', 0, N'UPDATE CMS_PageTemplateScope SET [PageTemplateScopePath] = @PageTemplateScopePath, [PageTemplateScopeLevels] = @PageTemplateScopeLevels, [PageTemplateScopeCultureID] = @PageTemplateScopeCultureID, [PageTemplateScopeClassID] = @PageTemplateScopeClassID, [PageTemplateScopeTemplateID] = @PageTemplateScopeTemplateID, [PageTemplateScopeSiteID] = @PageTemplateScopeSiteID, [PageTemplateScopeLastModified] = @PageTemplateScopeLastModified, [PageTemplateScopeGUID] = @PageTemplateScopeGUID WHERE [PageTemplateScopeID] = @PageTemplateScopeID', 0, 2337, 0, '20100222 09:40:56', '16e48145-1438-4e75-8ae8-ca4a8b85e6a7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9846, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_PageTemplateScope WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2337, 0, '20100222 09:40:56', '65a30880-4609-45a0-954d-2ce8c95f40dc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9847, N'selectspecbetween', 0, N'SELECT ##COLUMNS## FROM Analytics_Statistics, ##HITSTABLE## WHERE ##WHERE## AND StatisticsSiteID=@SiteID AND StatisticsCode=@CodeName AND StatisticsID=HitsStatisticsID AND HitsStartTime >= @StartTime AND HitsEndTime <= @EndTime', 0, 1366, 0, '20100215 16:12:54', '2ac9b98b-9c1e-4830-878b-211531bcfc37', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9859, N'SelectChildClassesForSite', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Class WHERE ClassID IN (SELECT ChildClassID FROM CMS_AllowedChildClasses WHERE ParentClassID=@ParentClassID) AND ClassID IN (SELECT ClassID FROM CMS_ClassSite WHERE SiteID = @SiteID)', 0, 145, 0, '20100222 13:22:37', 'fb0344f4-6fff-4e11-baff-c8ad5447b95e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9965, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_PageTemplateScope WHERE (PageTemplateScopeLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2337, 0, '20100302 15:47:50', '508c1279-138c-4d16-9b32-a15c88b5d1db', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10000, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_Tree_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 143, 0, '20100303 14:46:33', '70500db5-377f-4344-be2b-4f76d70ca8a0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10115, N'selectpreviousnext', 0, N'DECLARE @EventList TABLE (EventID INT, RN INT);
INSERT INTO @EventList (EventID, RN) SELECT EventID, ROW_NUMBER() OVER (ORDER BY ##ORDERBY##) AS RN FROM View_CMS_EventLog_Joined WHERE ##WHERE##;
DECLARE @num INT; SET @num = (SELECT RN FROM @EventList WHERE EventID = @EventID);
SELECT EventID, RN, @num AS BASE_RN FROM @EventList WHERE RN IN (@num - 1, @num + 1)', 0, 140, 0, '20100322 07:52:51', 'eb7f068b-8130-4075-b36d-d0f716568842', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10116, N'selectpreviousnext', 0, N'DECLARE @EmailList TABLE (EmailID INT, RN INT);
INSERT INTO @EmailList (EmailID, RN) SELECT EmailID, ROW_NUMBER() OVER (ORDER BY ##ORDERBY##) AS RN FROM CMS_Email WHERE ##WHERE##;
DECLARE @num INT; SET @num = (SELECT RN FROM @EmailList WHERE EmailID = @EmailID);
SELECT EmailID, RN, @num AS BASE_RN FROM @EmailList WHERE RN IN (@num - 1, @num + 1)', 0, 1809, 0, '20100322 07:53:10', '6501ee6c-4456-4e50-8083-faa64caf6c0f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9472, N'deleteexpiredsession', 1, N'Proc_CMS_Session_Delete_Expired', 0, 59, 0, '20091201 09:44:28', '5545d138-da66-4e77-b84a-19cf325e39f9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9473, N'deletesessionbysite', 1, N'Proc_CMS_Session_DeleteBySiteID', 0, 59, 0, '20091201 09:47:06', 'a0aad1ca-ac14-41c0-83e2-28d1636fd51c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9474, N'updatesession', 1, N'Proc_CMS_Session_Update', 1, 59, 0, '20091201 09:49:27', '5f5eb7ed-8883-4cb4-8613-66ff011f5c6c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9793, N'checkdependencies', 0, N'SELECT TOP 1 DiscountLevelID FROM  [COM_DiscountLevel] WHERE ((DiscountLevelID = (SELECT TOP 1 CustomerDiscountLevelID ID FROM [COM_Customer] WHERE CustomerDiscountLevelID = @ID)))', 0, 1429, 0, '20100104 15:52:53', 'cfca9f96-d39a-4ec6-9ebe-3a144edc5c5b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9815, N'refreshdatacounts', 0, N'UPDATE CMS_PageTemplateCategory SET CategoryChildCount = (SELECT Count(*) FROM CMS_PageTemplateCategory AS SUB WHERE SUB.CategoryParentID = CMS_PageTemplateCategory.CategoryID), CategoryTemplateChildCount = (SELECT Count(*) FROM CMS_PageTemplate AS SUB WHERE SUB.PageTemplateCategoryID = CMS_PageTemplateCategory.CategoryID)', 0, 405, 0, '20100120 10:24:12', 'f1fdd31b-ba1d-4e87-9ecf-585bf104bce9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9816, N'refreshdatacounts', 0, N'UPDATE CMS_WebPartCategory SET CategoryChildCount = (SELECT Count(*) FROM CMS_WebPartCategory AS SUB WHERE SUB.CategoryParentID = CMS_WebPartCategory.CategoryID), CategoryWebPartChildCount = (SELECT Count(*) FROM CMS_WebPart AS SUB WHERE SUB.WebPartCategoryID = CMS_WebPartCategory.CategoryID)', 0, 424, 0, '20100120 10:24:36', 'b09ca9ce-30f1-489d-b9a3-5bdf9745f18c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9817, N'refreshdatacounts', 0, N'UPDATE CMS_WidgetCategory SET WidgetCategoryChildCount = (SELECT Count(*) FROM CMS_WidgetCategory AS SUB WHERE SUB.WidgetCategoryParentID = CMS_WidgetCategory.WidgetCategoryID), WidgetCategoryWidgetChildCount = (SELECT Count(*) FROM CMS_Widget AS SUB WHERE SUB.WidgetCategoryID = CMS_WidgetCategory.WidgetCategoryID)', 0, 2198, 0, '20100120 10:25:02', '2e9aa6d5-1c0c-4e95-84c6-441c0bd78e16', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9071, N'getroleselements', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_SiteRoleResourceUIElement_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2195, 0, '20091009 16:19:10', '862748c2-a5e3-4a4f-be17-fdd2c9db20f9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9073, N'updateidpath', 1, N'Proc_CMS_UIElement_UpdateIDPath', 0, 2195, 0, '20090910 10:47:57', '13caa583-4d4a-4a4a-a028-7ac9edc6ffdd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9207, N'OrderAlphabetically', 1, N'Proc_CMS_WidgetCategory_OrderAlphaAsc', 0, 2198, 0, '20090923 15:16:45', 'c7af69d3-862a-4069-9a80-7a7e5a39da9d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9208, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_WidgetMetafile_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2197, 0, '20090924 10:51:00', '2d041b2e-97dc-443a-b6d4-ace39b610f52', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9081, N'insert', 0, N'INSERT INTO CMS_WidgetCategory ([WidgetCategoryName], [WidgetCategoryDisplayName], [WidgetCategoryParentID], [WidgetCategoryPath], [WidgetCategoryLevel], [WidgetCategoryOrder], [WidgetCategoryChildCount], [WidgetCategoryWidgetChildCount], [WidgetCategoryImagePath], [WidgetCategoryGUID], [WidgetCategoryLastModified] ) VALUES ( @WidgetCategoryName, @WidgetCategoryDisplayName, @WidgetCategoryParentID, @WidgetCategoryPath, @WidgetCategoryLevel, @WidgetCategoryOrder, @WidgetCategoryChildCount, @WidgetCategoryWidgetChildCount, @WidgetCategoryImagePath, @WidgetCategoryGUID, @WidgetCategoryLastModified); SELECT SCOPE_IDENTITY() AS [WidgetCategoryID]', 1, 2198, 0, '20091016 11:33:26', '6dbb7565-75e2-41e4-b018-bf4bcc81d6df', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9082, N'update', 0, N'UPDATE CMS_WidgetCategory SET [WidgetCategoryName] = @WidgetCategoryName, [WidgetCategoryDisplayName] = @WidgetCategoryDisplayName, [WidgetCategoryParentID] = @WidgetCategoryParentID, [WidgetCategoryPath] = @WidgetCategoryPath, [WidgetCategoryLevel] = @WidgetCategoryLevel, [WidgetCategoryOrder] = @WidgetCategoryOrder, [WidgetCategoryChildCount] = @WidgetCategoryChildCount, [WidgetCategoryWidgetChildCount] = @WidgetCategoryWidgetChildCount, [WidgetCategoryImagePath] = @WidgetCategoryImagePath, [WidgetCategoryGUID] = @WidgetCategoryGUID, [WidgetCategoryLastModified] = @WidgetCategoryLastModified WHERE [WidgetCategoryID] = @WidgetCategoryID', 0, 2198, 0, '20091016 11:33:26', '5a6c490c-9dcc-471d-92ad-61a8defd1dd8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9083, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WidgetCategory WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2198, 0, '20091016 11:33:26', 'd02c3065-8276-4275-8d9c-48bde64ba9f8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9084, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_WidgetRole WHERE [WidgetID] = @WidgetID AND [RoleID] = @RoleID AND [PermissionID] = @PermissionID', 0, 2199, 0, '20091016 11:33:36', 'e341fd1a-b5b5-4596-8dcd-c0a9939cb3fb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9085, N'delete', 0, N'DELETE FROM CMS_WidgetRole WHERE [WidgetID] = @WidgetID AND [RoleID] = @RoleID AND [PermissionID] = @PermissionID', 0, 2199, 0, '20091016 11:33:37', 'aaec8a42-3fc1-498b-9eee-7768aa3620d4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9086, N'insert', 0, N'INSERT INTO CMS_WidgetRole ([WidgetID], [RoleID], [PermissionID] ) VALUES ( @WidgetID, @RoleID, @PermissionID);', 1, 2199, 0, '20091016 11:33:37', '05e414f7-e9e3-46d2-b24a-485ecbb652fa', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9087, N'update', 0, N'SELECT NULL', 0, 2199, 0, '20091016 11:33:37', '8e4d6eeb-1188-4970-a91e-f74fd198337a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9088, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WidgetRole WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2199, 0, '20091016 11:33:37', 'f599a4ed-6413-49da-a790-128fb5f9b2f7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9102, N'UpdateChildPaths', 1, N'Proc_CMS_WidgetCategory_UpdateChildPaths', 1, 2198, 0, '20090911 16:30:55', 'd4dd7efb-7618-43f2-bc70-f327668cfca2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9103, N'UpdateCategoryChildCount', 0, N'UPDATE CMS_WidgetCategory SET WidgetCategoryChildCount = (SELECT COUNT(*) FROM CMS_WidgetCategory WHERE WidgetCategoryParentID = @CategoryID) WHERE WidgetCategoryID = @CategoryID', 0, 2198, 0, '20090911 16:55:38', 'd4c58f06-ecb1-4c2a-8e31-5247921ccba9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9104, N'UpdateCategoryWidgetChildCount', 0, N'UPDATE CMS_WidgetCategory SET WidgetCategoryWidgetChildCount = (SELECT COUNT(*) FROM CMS_Widget WHERE WidgetCategoryID = @CategoryID) WHERE WidgetCategoryID = @CategoryID', 0, 2198, 0, '20090911 17:08:26', '4eb3a661-d4f2-4d9f-b4da-e8ad8fd7319a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9106, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_WebPartMetafile_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 425, 0, '20090914 13:14:31', 'e291b187-069f-47be-945a-8eb9c5b6a794', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9195, N'selecttree', 0, N'SELECT (CASE WHEN EXISTS(SELECT TOP 1 ElementID FROM CMS_RoleUIElement WHERE CMS_RoleUIElement.RoleID = @RoleID AND CMS_RoleUIElement.ElementID = CMS_UIElement.ElementID) THEN 1 ELSE 0 END) AS ''ElementSelected'', CMS_UIElement.* FROM CMS_UIElement WHERE ElementResourceID = @ModuleID AND ##WHERE## ORDER BY ##ORDERBY##', 0, 2195, 0, '20091019 14:27:57', 'e4bf3545-6b1d-4b33-b451-78f545424ed7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9196, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_WebPartCategoryWebpart_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 424, 0, '20090915 13:33:42', 'd7532648-6592-4042-8b92-744e9fc35d7f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9203, N'selectallview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_WidgetCategoryWidget_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2198, 0, '20090916 15:17:50', '92ead224-2590-4e9e-b76a-36a9bbb6a3f2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9204, N'CheckDependencies', 0, N'SELECT TOP 1 DocumentID FROM View_CMS_Tree_Joined WHERE DocumentWorkflowStepID IN (SELECT StepID FROM CMS_WorkflowStep WHERE StepWorkflowID = @ID)', 0, 171, 0, '20090922 18:12:00', '70d8b10d-b486-4531-961a-d384e63eee2e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9205, N'RemoveDependencies', 1, N'Proc_CMS_Widget_RemoveDependencies', 0, 2197, 0, '20090923 14:24:52', '79376d65-b03c-40b4-ab52-d967d19306e4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7881, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Blog_PostSubscription WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2018, 0, '20081229 09:06:57', '41f61cda-d98c-43e4-989b-6f32a32ebeb6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7926, N'removeblogdependencies', 1, N'Proc_CMS_Document_RemoveBlogPostDependencies', 0, 144, 0, '20090106 11:36:13', '150c6afb-d687-49fe-9683-e2a7b82b0937', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7927, N'ChangeGroup', 0, N'UPDATE CMS_Tree SET NodeGroupID = @NodeGroupID WHERE NodeSiteID = @NodeSiteID AND ((NodeAliasPath LIKE @ChildNodeAliasPath) OR (NodeAliasPath = @NodeAliasPath))', 0, 143, 0, '20090112 12:29:01', '82bc6da3-a8ce-45b1-a40b-0d98ecdcc50d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10185, N'deleteolderglobaltasks', 1, N'Proc_Staging_Synchronization_DeleteOlderGlobalTasks', 1, 1131, 0, '20100415 14:32:30', 'e47cad7b-2256-4f73-8144-8261a3e450a1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10201, N'selectallwithanswercount', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_Poll_AnswerCount WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1330, 0, '20100426 15:49:15', '1147b09e-4f61-4f40-a5b8-fb94914de094', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5396, N'selectuppertree', 0, N'SELECT ##TOPN##  IsSecuredNode, DocumentStylesheetID, DocumentPageTemplateID, NodeDocType, NodeHeadTags, NodeCacheMinutes, DocumentPageTitle, DocumentPageKeyWords, DocumentPageDescription, NodeBodyElementAttributes, RequiresSSL, NodeID, DocumentID, DocumentCulture, NodeACLID, NodeLinkedNodeID, ClassName, NodeAliasPath FROM View_CMS_Tree_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 144, 0, '20100520 09:51:51', '600f3986-e5eb-4a3b-afb4-8eb2c3d5291b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (347, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Culture WHERE [CultureID] = @ID', 0, 1, 0, '20081229 09:06:58', 'cee54632-71a0-4d36-ac6a-936d7154a797', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (355, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Culture WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1, 0, '20081229 09:06:58', '2e9272c4-abdb-4ac2-8f4a-7c46fb91c6ce', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4848, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Culture WHERE (CultureLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1, 0, '20081229 09:06:58', '150ec2d0-3a2b-4edb-a264-e4b3388b0457', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2572, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Staging_Task WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1134, 0, '20100322 15:42:02', '3bd52425-ac57-4fa8-a7ae-87ef7e17e0bf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10288, N'selectsubscriptions', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_Newsletter_Subscriptions_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 912, 0, '20100624 15:17:20', '49b04d0f-cce8-4604-a49c-459a9b9e597b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10303, N'deleteversionsolderthan', 0, N'DELETE FROM Temp_File WHERE FileLastModified <= @OlderThan', 0, 2426, 0, '20100629 14:28:33', '99064bce-d264-4123-a6be-e2183731ab0e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10302, N'deleteversionsbyguid', 0, N'DELETE FROM Temp_File WHERE FileParentGUID = @ParentGUID AND ##WHERE##', 0, 2426, 0, '20100714 11:46:06', '714c8854-3966-498d-8891-0a3eba5d745e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10334, N'OrderAlphabetically', 1, N'Proc_CMS_ReportCategory_OrderAlphaAsc', 0, 1431, 0, '20100715 11:04:27', 'f661560f-ab02-4d7e-906f-9e643c3eae6e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3842, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Reporting_ReportCategory WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1431, 0, '20081229 09:07:21', '19e54ad9-805d-44a1-bfed-210bc0792466', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10372, N'updatecategorychildcount', 0, N'UPDATE Reporting_ReportCategory SET CategoryChildCount = (SELECT COUNT(*) FROM Reporting_ReportCategory WHERE CategoryParentID = @CategoryID) WHERE CategoryID = @CategoryID', 0, 1431, 0, '20100716 21:26:41', 'd7ee4a8f-3a5a-4318-a3c4-829b247d2570', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10373, N'UpdateChildPaths', 1, N'Proc_Reporting_ReportCategory_UpdatePath', 0, 1431, 0, '20100716 21:57:14', 'd964578b-4558-45e4-8992-bf426076e1de', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10374, N'updatecategoryreportchildcount', 0, N'UPDATE Reporting_ReportCategory SET CategoryReportChildCount = (SELECT COUNT(*) FROM Reporting_Report WHERE ReportCategoryID = @CategoryID) WHERE CategoryID = @CategoryID', 0, 1431, 0, '20100719 11:47:32', '1594f050-3480-4fbf-b0c0-9d08567bfd6a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10460, N'refreshdatacount', 0, N'UPDATE Reporting_ReportCategory SET CategoryChildCount = (SELECT Count(*) FROM Reporting_ReportCategory AS SUB WHERE SUB.CategoryParentID = Reporting_ReportCategory.CategoryID), CategoryReportChildCount = (SELECT Count(*) FROM Reporting_Report AS SUB WHERE SUB.ReportCategoryID = Reporting_ReportCategory.CategoryID)', 0, 1431, 0, '20100720 16:37:05', '6079e717-578d-4ff9-80a5-f4dc49fcdd10', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10461, N'removedependencies', 1, N'Proc_CMS_SettingsCategory_RemoveDependencies', 1, 1649, 0, '20100721 14:01:29', '679d12ad-b180-453e-84a2-7b492fff328d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10462, N'updateidpath', 1, N'Proc_CMS_SettingsCategory_UpdateIDPath', 0, 1649, 0, '20100721 14:35:10', '2ba5c8e4-70dd-4626-b2c5-566d12b4d450', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10463, N'setidpath', 0, N'UPDATE [CMS_SettingsCategory] SET [CategoryIDPath] = @Path WHERE [CategoryID] = @ID', 0, 1649, 0, '20100721 15:07:53', '32249190-d083-4c6d-9abe-ef02700c20cb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5234, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_SettingsCategory WHERE [CategoryID] = @ID', 0, 1649, 0, '20081229 09:07:23', '7fc4aa63-cf93-4a20-bde1-fe06d5be6e34', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5238, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SettingsCategory WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1649, 0, '20081229 09:07:23', '40929c38-fbc1-446b-ac46-45f790e9e968', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6905, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_AbuseReport WHERE [ReportID] = @ID', 0, 1896, 0, '20081230 17:04:41', '8f8215ea-c39f-4df7-9cf0-727adc829e51', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6906, N'delete', 0, N'DELETE FROM CMS_AbuseReport WHERE [ReportID] = @ID', 0, 1896, 0, '20081230 17:04:41', '56dce0fd-f185-4707-9495-2e0b4f31f1a7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6907, N'insert', 0, N'INSERT INTO CMS_AbuseReport ([ReportGUID], [ReportTitle], [ReportURL], [ReportCulture], [ReportObjectID], [ReportObjectType], [ReportComment], [ReportUserID], [ReportWhen], [ReportStatus], [ReportSiteID] ) VALUES ( @ReportGUID, @ReportTitle, @ReportURL, @ReportCulture, @ReportObjectID, @ReportObjectType, @ReportComment, @ReportUserID, @ReportWhen, @ReportStatus, @ReportSiteID); SELECT SCOPE_IDENTITY() AS [ReportID]', 1, 1896, 0, '20081230 17:04:41', '697594c7-9ee3-40f6-81aa-f41f42ea3f8e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6908, N'update', 0, N'UPDATE CMS_AbuseReport SET [ReportGUID] = @ReportGUID, [ReportTitle] = @ReportTitle, [ReportURL] = @ReportURL, [ReportCulture] = @ReportCulture, [ReportObjectID] = @ReportObjectID, [ReportObjectType] = @ReportObjectType, [ReportComment] = @ReportComment, [ReportUserID] = @ReportUserID, [ReportWhen] = @ReportWhen, [ReportStatus] = @ReportStatus, [ReportSiteID] = @ReportSiteID WHERE [ReportID] = @ReportID', 0, 1896, 0, '20081230 17:04:41', '35efc6d9-5556-4d98-9b2c-6f3dbbf08a1b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6909, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_AbuseReport WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1896, 0, '20081230 17:04:41', '73360cbb-33cc-4c23-b1c7-e2ed6842dd8a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10527, N'InitPermissionOrders', 1, N'Proc_CMS_Permission_InitPermissionOrders', 0, 131, 0, '20100804 08:50:18', '6908f94d-4b82-4f81-bee1-861246280722', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10528, N'MovePermissionUp', 1, N'Proc_CMS_Permission_MovePermissionUp', 0, 131, 0, '20100804 08:51:26', '86a967b5-9f8b-456e-a80b-08fdbbf28f5b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10529, N'MovePermissionDown', 1, N'Proc_CMS_Permission_MovePermissionDown', 0, 131, 0, '20100804 08:52:04', '8f6c5bbb-de7a-4517-bb17-6472df756ecd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6985, N'selectusersession', 0, N'SELECT DISTINCT ##TOPN## ##COLUMNS## FROM View_CMS_User WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 59, 0, '20100331 10:57:41', '93c385b6-dbee-4fd8-8840-68ee0ee56811', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3928, N'SelectAllForSubExport', 0, N'SELECT DISTINCT SubscriberEmail, SubscriberFirstName, SubscriberLastName FROM Newsletter_Subscriber WHERE (SubscriberSiteID = @SiteID AND NOT SubscriberEmail IS NULL) AND ##WHERE##', 0, 908, 0, '20100628 15:35:38', '65bef9d3-42ef-4a48-bc4d-d6fd5082f4f4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2303, N'selectdocuments', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_Tree_Joined WHERE (##WHERE##) AND (ClassName = ''CMS.Root'') ORDER BY ##ORDERBY##', 0, 1095, 0, '20090422 16:14:08', 'd1f288db-16a5-48d2-b67e-8213d62260f4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2357, N'selectversions', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_Tree_Joined_Versions WHERE (##WHERE##) AND (ClassName = ''CMS.Root'') ORDER BY ##ORDERBY##', 0, 1095, 0, '20090422 16:14:08', 'eb371477-e4bd-4669-852a-000e4d028f59', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5794, N'selectattachments', 0, N'SELECT View_CMS_Tree_Joined.*, CONTENT_File.*, CMS_Attachment.AttachmentID ,CMS_Attachment.AttachmentName, CMS_Attachment.AttachmentExtension, CMS_Attachment.AttachmentSize, CMS_Attachment.AttachmentMimeType, CMS_Attachment.AttachmentImageWidth, CMS_Attachment.AttachmentImageHeight, CMS_Attachment.AttachmentDocumentID, CMS_Attachment.AttachmentGUID, CMS_Attachment.AttachmentLastHistoryID  FROM View_CMS_Tree_Joined INNER JOIN CONTENT_File ON View_CMS_Tree_Joined.DocumentForeignKeyValue = CONTENT_File.FileID LEFT OUTER JOIN CMS_Attachment ON CONTENT_File.FileAttachment = CMS_Attachment.AttachmentGUID AND View_CMS_Tree_Joined.DocumentID = CMS_Attachment.AttachmentDocumentID WHERE View_CMS_Tree_Joined.ClassName = ''CMS.File'' AND CMS_Attachment.AttachmentID IS NOT NULL AND ##WHERE## ORDER BY ##ORDERBY##', 0, 1685, 1, '20080313 09:35:00', 'e89835c0-1964-4b0d-8386-c55260c41091', 0, 1)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10542, N'refreshdatacounts', 0, N'-- Correct all IDPaths and child counts
DECLARE @elementCursor CURSOR;
SET @elementCursor = CURSOR FOR SELECT [ElementID] FROM [CMS_UIElement] ORDER BY [ElementLevel], [ElementID]
DECLARE @elementID int;
OPEN @elementCursor
FETCH NEXT FROM @elementCursor INTO @elementID;
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE CMS_UIElement SET ElementChildCount = (SELECT COUNT(*) FROM CMS_UIElement b WHERE b.ElementParentID = a.ElementID), ElementIDPath = ISNULL((SELECT TOP 1 ElementIDPath FROM CMS_UIElement b WHERE b.ElementID = a.ElementParentID), '''') + ''/'' + REPLICATE(''0'', 8 - DATALENGTH(ElementID)) + CAST(ElementID AS NVARCHAR(200)) FROM CMS_UIElement a WHERE ElementID = @elementID
FETCH NEXT FROM @elementCursor INTO @elementID;
END
CLOSE @elementCursor;
DEALLOCATE @elementCursor;', 0, 2195, 0, '20100805 12:01:57', 'de7a9085-5bf1-4e2d-90c3-c8c5cc4e3fa5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10543, N'refreshdatacounts', 0, N'-- Correct all IDPaths and child counts
DECLARE @categoryCursor CURSOR;
SET @categoryCursor = CURSOR FOR SELECT [CategoryID] FROM [CMS_SettingsCategory] ORDER BY [CategoryLevel], [CategoryID]
DECLARE @categoryID int;
OPEN @categoryCursor
FETCH NEXT FROM @categoryCursor INTO @categoryID;
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE CMS_SettingsCategory SET CategoryChildCount = (SELECT COUNT(*) FROM CMS_SettingsCategory b WHERE b.CategoryParentID = a.CategoryID), CategoryIDPath = ISNULL((SELECT TOP 1 CategoryIDPath FROM CMS_SettingsCategory b WHERE b.CategoryID = a.CategoryParentID), '''') + ''/'' + REPLICATE(''0'', 8 - DATALENGTH(CategoryID)) + CAST(CategoryID AS NVARCHAR(200)) FROM CMS_SettingsCategory a WHERE CategoryID = @categoryID
FETCH NEXT FROM @categoryCursor INTO @categoryID;
END
CLOSE @categoryCursor;
DEALLOCATE @categoryCursor;', 0, 1649, 0, '20100805 12:03:58', '6a2f4737-cee2-4a2d-8df1-f5a58f013b26', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6686, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Personalization WHERE [PersonalizationID] = @ID', 0, 1841, 0, '20091016 11:33:52', 'a0a3ee0e-72f0-401b-aed8-91f4bdf1b5d2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6690, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Personalization WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1841, 0, '20091016 11:33:52', '5603182b-cfbb-4221-82f9-e7021c5af608', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7458, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Personalization WHERE (PersonalizationLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1841, 0, '20091016 11:33:52', 'f29f78d5-e8a0-41aa-a437-a7312af2c5f3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10547, N'select', 0, N'SELECT ##COLUMNS## FROM COM_ShippingCost WHERE [ShippingCostID] = @ID', 0, 2461, 0, '20100809 10:06:59', '2a6c1e0f-8721-4f91-8463-9e6bc37a0308', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10548, N'delete', 0, N'DELETE FROM COM_ShippingCost WHERE [ShippingCostID] = @ID', 0, 2461, 0, '20100809 10:06:59', '42465bb8-8ce2-47a3-ba99-fc3c14345e68', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10549, N'insert', 0, N'INSERT INTO COM_ShippingCost ([ShippingCostShippingOptionID], [ShippingCostMinWeight], [ShippingCostValue], [ShippingCostGUID], [ShippingCostLastModified] ) VALUES ( @ShippingCostShippingOptionID, @ShippingCostMinWeight, @ShippingCostValue, @ShippingCostGUID, @ShippingCostLastModified); SELECT SCOPE_IDENTITY() AS [ShippingCostID]', 1, 2461, 0, '20100809 10:06:59', '0873fac6-c389-4ca1-9590-bff0e63ff3a6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10550, N'update', 0, N'UPDATE COM_ShippingCost SET [ShippingCostShippingOptionID] = @ShippingCostShippingOptionID, [ShippingCostMinWeight] = @ShippingCostMinWeight, [ShippingCostValue] = @ShippingCostValue, [ShippingCostGUID] = @ShippingCostGUID, [ShippingCostLastModified] = @ShippingCostLastModified WHERE [ShippingCostID] = @ShippingCostID', 0, 2461, 0, '20100809 10:06:59', 'a9e8ef67-71db-4d07-8ab6-1083eaf1a0bc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10551, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_ShippingCost WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2461, 0, '20100809 10:06:59', '7b699a85-7cda-4aff-9f4f-7f37a2226c3e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10557, N'select', 0, N'SELECT ##COLUMNS## FROM COM_ShippingOptionTaxClass WHERE [ShippingOptionID] = @ShippingOptionID AND [TaxClassID] = @TaxClassID', 0, 2463, 0, '20100809 10:14:25', '0918fac5-47de-4791-be59-f5fce519e9a0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10558, N'delete', 0, N'DELETE FROM COM_ShippingOptionTaxClass WHERE [ShippingOptionID] = @ShippingOptionID AND [TaxClassID] = @TaxClassID', 0, 2463, 0, '20100809 10:14:25', '392e010b-c829-4df0-bce1-bf94ca2d1a8e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10559, N'insert', 0, N'INSERT INTO COM_ShippingOptionTaxClass ([ShippingOptionID], [TaxClassID] ) VALUES ( @ShippingOptionID, @TaxClassID);', 1, 2463, 0, '20100809 10:14:25', 'aa44e040-b73d-4d15-bac4-5117c1ef1142', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10560, N'update', 0, N'SELECT NULL', 0, 2463, 0, '20100809 10:14:25', '100379e0-f2db-4538-9868-4d97f8f8767c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10561, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_ShippingOptionTaxClass WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2463, 0, '20100809 10:14:25', '7f7d6ee7-fa23-478e-a76e-8325a24b9f06', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10587, N'getlastorder', 0, N'DECLARE @Order int;
SET @Order = 0;
  IF @ClassID > 0 
    BEGIN
      SELECT @Order = ISNULL(MAX([PermissionOrder]), 0) FROM [CMS_Permission] WHERE [ClassID] = @ClassID 
    END
  ELSE IF @ResourceID > 0
    BEGIN
      SELECT @Order = ISNULL(MAX([PermissionOrder]), 0) FROM [CMS_Permission] WHERE [ResourceID] = @ResourceID
    END
SELECT @Order AS [PermissionOrder]', 0, 131, 0, '20100813 10:00:07', '9106f19a-4b8e-4a66-8e1b-42ca7ffe1ad6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10588, N'selectmanagedbyuser', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Community_Group JOIN Community_GroupMember ON Community_Group.GroupID = Community_GroupMember.MemberGroupID 
JOIN CMS_User ON  Community_GroupMember.MemberUserID = CMS_User.UserID JOIN CMS_Role ON Community_Group.GroupID = CMS_Role.RoleGroupID 
WHERE Community_Group.GroupSiteID = @SiteID AND CMS_User.UserID = @UserID AND CMS_Role.RoleIsGroupAdministrator = 1 ORDER BY ##ORDERBY##', 0, 1748, 0, '20100813 16:23:36', '648042eb-4aff-4289-9282-ea076fa8499b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4841, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_SettingsKey WHERE [KeyID] = @ID', 0, 1611, 0, '20091026 14:34:13', '6cf001b7-1389-43b8-b845-06094654744b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4845, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SettingsKey WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1611, 0, '20091026 14:34:13', 'b89bbc9f-61c0-4d92-b066-9ff7a6bdc6cd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4930, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SettingsKey WHERE (KeyLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1611, 0, '20091026 14:34:13', '5e2e0266-052c-4b79-ad12-f866b5da5177', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1384, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_WebPartContainer WHERE [ContainerID] = @ID', 0, 929, 0, '20081229 09:07:40', 'e45a049a-32ce-4339-a830-621cdb14edfa', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1388, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WebPartContainer WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 929, 0, '20081229 09:07:40', '16051b46-4a5e-4995-9904-9d64dc07399a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4863, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WebPartContainer WHERE (ContainerLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 929, 0, '20081229 09:07:40', '00dbc1c2-f0dd-4b60-a554-f86b0e4b1669', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10309, N'getversionsolderthan', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Temp_File WHERE FileLastModified <= @OlderThan AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2426, 0, '20100825 18:16:10', '1b26283a-638c-43a7-b557-96903d42ca83', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1281, N'selectByFormName', 0, N'SELECT * FROM CMS_Form WHERE FormName = @FormName AND FormSiteID = @FormSiteID', 0, 880, 0, '20100826 18:03:01', '587a3e75-4b4d-4f3b-95f7-14aadbfa6a29', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10009, N'update', 0, N'UPDATE CMS_OpenIDUser SET [OpenID] = @OpenID, [OpenIDProviderURL] = @OpenIDProviderURL, [UserID] = @UserID WHERE [OpenIDUserID] = @OpenIDUserID', 0, 2371, 0, '20100826 18:04:44', 'db998222-0c80-44b8-8cba-7ea63c5b56e2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10007, N'delete', 0, N'DELETE FROM CMS_OpenIDUser WHERE [OpenIDUserID] = @ID', 0, 2371, 0, '20100826 18:05:00', 'a711b559-e201-4439-9bde-13c2f1e260a0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10008, N'insert', 0, N'INSERT INTO CMS_OpenIDUser ([OpenID], [OpenIDProviderURL], [UserID] ) VALUES ( @OpenID, @OpenIDProviderURL, @UserID); SELECT SCOPE_IDENTITY() AS [OpenIDUserID]', 1, 2371, 0, '20100826 18:05:06', '3108b9bf-7aa2-4d90-b284-b79a847e8fb4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10006, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_OpenIDUser WHERE [OpenIDUserID] = @ID', 0, 2371, 0, '20100826 18:05:12', 'f0fb5c48-c224-4abd-b4e6-8c6f672315da', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10010, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_OpenIDUser WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2371, 0, '20100826 18:05:19', 'ecc5d8d0-4445-41a7-b970-5444f208cd99', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10660, N'deleteAll', 0, N'DELETE FROM Forums_ForumRoles WHERE ##WHERE##', 0, 1644, 0, '20100827 12:38:38', '8d5b94f9-98c5-43a3-97a2-c7364e495018', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10662, N'deleteAll', 0, N'DELETE FROM Media_LibraryRolePermission WHERE ##WHERE##', 0, 1937, 0, '20100827 12:40:21', 'cd91a5bf-e785-4c5c-8433-70919fb722af', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10663, N'setPermissions', 1, N'Proc_Media_Library_SetPermissions', 0, 1937, 0, '20100827 12:40:40', 'a47ce552-7c97-4678-aa40-16b9cc77b74d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (365, N'selectsites', 0, N'SELECT CMS_Site.*, CMS_SiteCulture.CultureID FROM CMS_Site LEFT OUTER JOIN CMS_SiteCulture ON CMS_SiteCulture.SiteID = CMS_Site.SiteID AND (CMS_SiteCulture.CultureID = @CultureID OR CMS_SiteCulture.CultureID IS NULL) ORDER BY ##ORDERBY##', 0, 1, 0, '20100827 13:30:22', '0c79a0db-927b-48a1-a052-567c82670520', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (212, N'selectsites', 0, N'SELECT * FROM CMS_Site LEFT JOIN (SELECT * FROM CMS_ResourceSite WHERE ResourceID = @ResourceID) Resources ON Resources.SiteID = CMS_Site.SiteID ORDER BY ''SiteDisplayName''', 0, 134, 0, '20100827 13:41:36', 'f625dd85-d5dc-4116-8aaf-b7515d473719', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9074, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Widget WHERE [WidgetID] = @ID', 0, 2197, 0, '20091125 09:08:30', '367c346f-cb28-4f44-b159-40cb2a521c8d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9075, N'delete', 0, N'DELETE FROM CMS_Widget WHERE [WidgetID] = @ID', 0, 2197, 0, '20091125 09:08:30', 'aaf2aac9-9b5b-4cc6-8cb6-662a519be406', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9076, N'insert', 0, N'INSERT INTO CMS_Widget ([WidgetWebPartID], [WidgetDisplayName], [WidgetName], [WidgetDescription], [WidgetCategoryID], [WidgetProperties], [WidgetSecurity], [WidgetGUID], [WidgetLastModified], [WidgetIsEnabled], [WidgetForGroup], [WidgetForEditor], [WidgetForUser], [WidgetForDashboard], [WidgetForInline], [WidgetDocumentation], [WidgetDefaultValues] ) VALUES ( @WidgetWebPartID, @WidgetDisplayName, @WidgetName, @WidgetDescription, @WidgetCategoryID, @WidgetProperties, @WidgetSecurity, @WidgetGUID, @WidgetLastModified, @WidgetIsEnabled, @WidgetForGroup, @WidgetForEditor, @WidgetForUser, @WidgetForDashboard, @WidgetForInline, @WidgetDocumentation, @WidgetDefaultValues); SELECT SCOPE_IDENTITY() AS [WidgetID]', 1, 2197, 0, '20100809 13:21:30', '5ab67883-a44f-41a3-b59a-99200f23ebaa', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9077, N'update', 0, N'UPDATE CMS_Widget SET [WidgetWebPartID] = @WidgetWebPartID, [WidgetDisplayName] = @WidgetDisplayName, [WidgetName] = @WidgetName, [WidgetDescription] = @WidgetDescription, [WidgetCategoryID] = @WidgetCategoryID, [WidgetProperties] = @WidgetProperties, [WidgetSecurity] = @WidgetSecurity, [WidgetGUID] = @WidgetGUID, [WidgetLastModified] = @WidgetLastModified, [WidgetIsEnabled] = @WidgetIsEnabled, [WidgetForGroup] = @WidgetForGroup, [WidgetForEditor] = @WidgetForEditor, [WidgetForUser] = @WidgetForUser, [WidgetForDashboard] = @WidgetForDashboard, [WidgetForInline] = @WidgetForInline, [WidgetDocumentation] = @WidgetDocumentation, [WidgetDefaultValues] = @WidgetDefaultValues WHERE [WidgetID] = @WidgetID', 0, 2197, 0, '20100809 13:23:42', 'a314f14e-846e-4c4b-9fba-4e6eb95098c4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9078, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Widget WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2197, 0, '20091125 09:08:30', '085bca11-6129-418f-9ee0-d1da75e96cc1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9262, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Widget WHERE (WidgetLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2197, 0, '20091125 09:08:30', '93173265-020f-440f-809c-028d9b09b93c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (393, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Workflow WHERE [WorkflowID] = @ID', 0, 171, 0, '20081229 09:07:41', '0f4ef3f9-d7ef-4bd6-af5e-c92e795872b4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (417, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Workflow WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 171, 0, '20081229 09:07:41', '1b69784d-6132-4f32-bc20-a0c28aa509d7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4864, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Workflow WHERE (WorkflowLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 171, 0, '20081229 09:07:41', 'e84eef66-afa3-4ae7-812a-cc9f6451fdd0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3598, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Analytics_DayHits WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1368, 0, '20081229 09:06:53', '4dd90948-5297-4dfa-aa18-5821cc4670b9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3588, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Analytics_HourHits WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1367, 0, '20081229 09:06:53', 'eb875710-492a-43b0-97c9-b4b98829e71f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3603, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Analytics_MonthHits WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1369, 0, '20081229 09:06:53', '7130afca-7910-4a00-8032-3e8c90b41c9b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3608, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Analytics_WeekHits WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1370, 0, '20081229 09:06:53', 'd2ba02c7-0964-4641-a020-4f43ed1eb21b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3613, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Analytics_YearHits WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1371, 0, '20081229 09:06:53', '9e53eee1-fd64-4abb-809d-319fae04156f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10661, N'setPermissions', 1, N'Proc_Forums_Forum_SetPermissions', 0, 1644, 0, '20100831 17:20:40', '1d2a68bf-c6e8-4f00-ae33-0a1387742b27', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10682, N'removedependencies', 0, N'DELETE FROM OM_ABVariant WHERE ABVariantTestID = @ID', 0, 2491, 0, '20100901 18:40:00', 'b26fe1d8-a80d-418f-bc4d-8a22c50b7ad2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (455, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_ACL WHERE [ACLID] = @ID', 0, 233, 0, '20081229 09:06:53', 'd0129efb-69c8-4469-9691-633fa7bd360c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5221, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_ACL WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 233, 0, '20081229 09:06:53', 'd9f29ec2-4ba0-4ea1-8c67-4c3a41672af4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7381, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_ACL WHERE (ACLLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 233, 0, '20091012 09:35:21', '340d3c6d-477a-4d2b-b5cf-9b89258ae30f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10545, N'getalloweditems', 0, N'SELECT ##COLUMNS## FROM View_CMS_ACLItem_ItemsAndOperators WHERE ##WHERE##', 0, 225, 0, '20100906 14:45:33', 'd93bfebe-1cbe-4031-b84e-8df999d7cdf2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2573, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Staging_Server WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1132, 0, '20100907 09:46:39', '6269cf91-96fd-48df-994e-c9bf14611222', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (513, N'selectdocumenthistory', 0, N'SELECT ##TOPN## ##COLUMNS##, VersionNumber + '' ('' + CAST(ModifiedWhen AS nvarchar(150)) + '')'' AS VersionModified FROM CMS_VersionHistory LEFT OUTER JOIN CMS_User ON CMS_User.UserID = CMS_VersionHistory.ModifiedByUserID WHERE DocumentID = @DocumentID AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 214, 0, '20100907 10:05:41', '5080c1d6-384a-4b93-a581-926dfd447c59', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (510, N'SelectRolesAndUsersForSite', 0, N'SELECT * FROM (SELECT ''U'' + CAST(CMS_User.UserID AS nvarchar(50)) AS OperatorID, FullName + '' ('' + CMS_User.UserName + '')'' AS OperatorName, CMS_User.UserIsHidden AS Hidden, NULL AS GroupID, NULL AS RoleName FROM CMS_User, CMS_UserSite WHERE (CMS_User.UserName LIKE @Search OR CMS_User.FullName LIKE @Search) AND (CMS_User.UserID = CMS_UserSite.UserID AND CMS_UserSite.SiteID=@SiteID) UNION SELECT ''R'' + CAST(RoleID AS nvarchar(50)) AS OperatorID, RoleDisplayName AS OperatorName, 0 AS Hidden, RoleGroupID AS GroupID, RoleName AS RoleName FROM CMS_Role WHERE RoleDisplayName LIKE @Search AND SiteID = @SiteID) AS Operators WHERE ##WHERE## ORDER BY OperatorName', 0, 56, 0, '20100907 10:07:46', '4ec5d38d-3a3e-43c4-a9f1-618fca3b44bf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (956, N'selectallofsite', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_RelationshipName WHERE ((@SiteID = 0) OR (RelationshipNameID IN (SELECT RelationshipNameID FROM CMS_RelationshipNameSite WHERE SiteID = @SiteID))) AND (##WHERE##)', 0, 530, 0, '20100907 10:09:03', 'fb42d18c-4966-49a7-bb2d-a3ef840e9712', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3583, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Analytics_Statistics WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1366, 0, '20081229 09:06:53', '08f3aa86-a902-450e-8562-cfb118c9c74d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8059, N'delete', 0, N'DELETE FROM CMS_SearchTask WHERE [SearchTaskID] = @ID', 0, 2046, 0, '20100921 15:54:36', 'e40bb411-8fde-4da5-925a-e6706e87512a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8060, N'insert', 0, N'INSERT INTO CMS_SearchTask ([SearchTaskType], [SearchTaskObjectType], [SearchTaskField], [SearchTaskValue], [SearchTaskServerName], [SearchTaskStatus], [SearchTaskPriority], [SearchTaskCreated] ) VALUES ( @SearchTaskType, @SearchTaskObjectType, @SearchTaskField, @SearchTaskValue, @SearchTaskServerName, @SearchTaskStatus, @SearchTaskPriority, @SearchTaskCreated); SELECT SCOPE_IDENTITY() AS [SearchTaskID]', 1, 2046, 0, '20100921 15:54:46', '4b5029cb-3907-4b87-bbc7-3f2c9286e268', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8058, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_SearchTask WHERE [SearchTaskID] = @ID', 0, 2046, 0, '20100921 15:54:56', '9320aa4b-128b-4613-9658-838d85c97d46', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8062, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SearchTask WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2046, 0, '20100921 15:55:04', 'c4d4aa75-259e-479b-9c37-454f2e0868ff', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8061, N'update', 0, N'UPDATE CMS_SearchTask SET [SearchTaskType] = @SearchTaskType, [SearchTaskObjectType] = @SearchTaskObjectType, [SearchTaskField] = @SearchTaskField, [SearchTaskValue] = @SearchTaskValue, [SearchTaskServerName] = @SearchTaskServerName, [SearchTaskStatus] = @SearchTaskStatus, [SearchTaskPriority] = @SearchTaskPriority, [SearchTaskCreated] = @SearchTaskCreated WHERE [SearchTaskID] = @SearchTaskID', 0, 2046, 0, '20100921 15:55:13', 'a136b51d-d7b9-4996-a700-0ecd9f512557', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1258, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_InlineControl WHERE [ControlID] = @ID', 0, 877, 0, '20081229 09:07:09', 'bfdaf3d1-cef1-4527-9d6b-a9870ea0181f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1262, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_InlineControl WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 877, 0, '20081229 09:07:09', '0796782a-a4c0-4784-8559-9a9b2b399d0b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4852, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_InlineControl WHERE (ControlLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 877, 0, '20081229 09:07:09', '1a3755c0-227b-4cf8-85d8-f64abe7a78d8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8070, N'deleteall', 0, N'DELETE FROM CMS_SearchIndexCulture WHERE ##WHERE##', 0, 2045, 0, '20101005 09:18:00', '43fbedfd-cf25-4628-9b68-af1f0db85d7c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8051, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_SearchIndexCulture WHERE [IndexID] = @IndexID AND [IndexCultureID] = @IndexCultureID', 0, 2045, 0, '20101005 09:19:20', '0aadd8c0-fdc3-4732-8294-98fdf6f3a1d1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8052, N'delete', 0, N'DELETE FROM CMS_SearchIndexCulture WHERE [IndexID] = @IndexID AND [IndexCultureID] = @IndexCultureID', 0, 2045, 0, '20101005 09:20:30', '573b6925-b67a-450e-8b60-e341c18d71c3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8053, N'insert', 0, N'INSERT INTO CMS_SearchIndexCulture ([IndexID], [IndexCultureID] ) VALUES ( @IndexID, @IndexCultureID);', 1, 2045, 0, '20101005 09:20:45', 'daa769e3-0d46-48bd-8274-a460ebfeea05', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8055, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SearchIndexCulture WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2045, 0, '20101005 09:20:59', 'ace966d3-67b3-4d0f-aa96-e10ad9c7f4f2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8046, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_SearchIndexSite WHERE [IndexID] = @IndexID AND [IndexSiteID] = @IndexSiteID', 0, 2044, 0, '20101005 09:21:21', 'e0568e28-a426-49cf-ac87-1ef02f2a9b1d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8047, N'delete', 0, N'DELETE FROM CMS_SearchIndexSite WHERE [IndexID] = @IndexID AND [IndexSiteID] = @IndexSiteID', 0, 2044, 0, '20101005 09:21:34', '4184b56e-8ece-4eb9-8ffd-f9d491e9546f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8048, N'insert', 0, N'INSERT INTO CMS_SearchIndexSite ([IndexID], [IndexSiteID] ) VALUES ( @IndexID, @IndexSiteID);', 1, 2044, 0, '20101005 09:21:53', 'f7d2853f-2992-4d73-990d-42a9fb2b2fdd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8050, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SearchIndexSite WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2044, 0, '20101005 09:22:08', '30e6d4c9-ea1a-44f9-bbb4-c82a342541e6', 0, NULL)
SET IDENTITY_INSERT [CMS_Query] OFF
